<div ng-controller="ClassesCtrl" ng-init="addAction()" class="sui-form form-horizontal">
    <ul class="sui-breadcrumb">
        <li><a href="#/classes/list">课程表</a></li>
        <li class="active">
            {{!class ?"创建":"edit"|translate}}
        </li>
    </ul>
    <form name="itemForm" novalidate>
        <table class="sui-table table-bordered" ng-show="order_id">
            <thead>
                <tr>
                    <th>{{'订单号'|translate}}</th>
                    <th>用户信息</th>
                    <th>{{'课程/数量'|translate}}</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td width="100px"> {{order.order_id}}</td>
                    <td width="100px">
                        <wxinfo ng-model="order.member_id" stye="1"></wxinfo>
                    </td>
                    <td>
                        <table class="sui-table table-bordered">
                            <tr ng-repeat="(skey, item) in order.items">
                                <td><img ng-src="{{item.image}}" width="100"></td>
                                <td>
                                    <span>
                                     选择课程:
                                     <classcategory-list ng-model="item.class_category_id" dft="1" ></classcategory-list>
                                </span>
                                </td>
                                <td>
                                    <span>
                                 课程名称:
                                {{item.title}}
                                </span>
                                </td>
                                <td>
                                    <span>
                                 过期时间:
                                 <input datetimepicker ng-model="item.expiry_time" required>
                                </span>
                                </td>
                                <td>
                                    <span>
                                     课程总数:
                                    <input ng-model="item.total_num" name="item.total_num" type="number" value="" class="input-medium" required>
                                </span>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <!-- <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <button type="submit"  class="sui-btn btn-primary"  ng-disabled="itemForm.$invalid" ng-click="itemAdd($event)">
                    <span>{{'save' | translate}}</span>
                </button>
            </div>
            
        </div> -->
        <div ng-show="class_id || !order_id">
            <div class="control-group">
                <label class="control-label v-top"><b style="color: #f00;">*</b> {{'课程类目'| translate}}：</label>
                <div class="controls">
                    <div class="zTreeDemoBackground">
                        <classcategory-list ng-model="class.class_category_id" dft="1"></classcategory-list>
                    </div>
                    <div ng-show="!class.class_category_id" class="sui-msg msg-error msg-clear help-block error">
                        <div class="msg-con">{{'required'| translate}}</div>
                        <s class="msg-icon"></s>
                    </div>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label v-top"><b style="color: #f00;">*</b> {{'过期时间'| translate}}：</label>
                <div class="controls">
                    <div class="zTreeDemoBackground">
                        <input datetimepicker ng-model="class.expiry_time" required>
                    </div>
                    <div ng-show="!class.expiry_time" class="sui-msg msg-error msg-clear help-block error">
                        <div class="msg-con">{{'required'| translate}}</div>
                        <s class="msg-icon"></s>
                    </div>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label v-top"><b style="color: #f00;">*</b> {{'课程总数'| translate}}：</label>
                <div class="controls">
                    <div class="zTreeDemoBackground">
                        <input ng-model="class.total_num" name="total_num" type="number" value="" class="input-xlarge" required>
                    </div>
                    <div ng-show="!class.total_num" class="sui-msg msg-error msg-clear help-block error">
                        <div class="msg-con">{{'required'| translate}}</div>
                        <s class="msg-icon"></s>
                    </div>
                </div>
            </div>
            <div class="control-group" ng-show="!class_id">
                <label class="control-label v-top"><b style="color: #f00;">*</b> {{'选择用户'| translate}}：</label>
                <div class="controls">
                    <div class="zTreeDemoBackground">
                        <wxinfo ng-model="class.member_id" stye="1"></wxinfo>
                        <br/>
                        <chose-member member-check="memberdata(memberInfo,1)" title="选择用户" app="1"></chose-member>
                    </div>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label v-top"><b style="color: #f00;">*</b> {{'课程剩余数量'| translate}}：</label>
                <div class="controls">
                    <div class="zTreeDemoBackground">
                        <input ng-model="class.left_num" name="left_num" type="number" value="" class="input-xlarge" required>
                    </div>
                    <div ng-show="!class.left_num" class="sui-msg msg-error msg-clear help-block error">
                        <div class="msg-con">{{'required'| translate}}</div>
                        <s class="msg-icon"></s>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="control-group">
        <label class="control-label"></label>
        <div class="controls">
            <button type="submit" id="submit" class="sui-btn btn-primary" ng-click="classAdd($event)">
                <span>{{'save' | translate}}</span>
            </button>
        </div>
    </div>
</div>